module.exports = {
  Codes: {
    OK: 0,
    BAD_REQUEST: 400,
    UNAUTHORIZED: 401,
    FORBIDDEN: 403,
    NOT_FOUND: 404,
    CONFLICT: 409,
    VALIDATION_FAILED: 422,
    SERVER_ERROR: 500,
    // 兼容旧逻辑
    FAIL: 1,
  },
  success(data = null, message = '操作成功', code = 0) {
    return { success: true, code, message, data };
  },
  fail(message = '操作失败', code = 1) {
    return { success: false, code, message };
  }
};